#ifndef SERVER_H
#define SERVER_H
#include <QThread>
#include <QMainWindow>
#include <vector>
#include <QTcpSocket>
#include <QTcpServer>//找不到头文件是因为在.pro文件中没有+network

class server : public QThread
{
    Q_OBJECT
signals:
    void getmsg(QString);
private:
    int id;
    QString name;//可以从数据库读取name信息后构造给name
    QTcpSocket* anysocket;
public:
    explicit server(int inid,QTcpSocket* insocket);
protected:
    void run() override;
    void initserver();//初始化服务器，绑定，监听，循环中建立连接，新连接扔给子线程
};

#endif // SERVER_H
